//
//  LoginViewController.swift
//  swiftDemo
//
//  Created by Gerry on 2021/10/29.
//

import UIKit
//import SnapKit


class LoginViewController: BaseViewController {

    lazy var button = UIButton.init(type: .custom)
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        self.title = "登录"
        self.view.backgroundColor = .white
//        button.frame = CGRect.init(x: 10, y: 80, width: 100, height: 40)
        
        setupCustomViews()
        layoutCustomViews()
        
    }
    
    func setupCustomViews() {
        button.addTarget(self, action: #selector(tapped(_:)), for: UIControl.Event.touchUpInside)
        button.setTitle("Login", for: UIControl.State.normal)
        button.backgroundColor = .orange
        self.view.addSubview(button)
        
    
    }
    
    func layoutCustomViews() {
        button.snp.makeConstraints { make in
            make.left.equalTo(self.view).offset(15)
            make.top.equalTo(self.view).offset(90)
            make.size.equalTo(CGSize.init(width: 100, height: 50))
        }
    }
    

    @objc func tapped(_ btn: UIButton) {
        let mainVC = MainTabBarController()
        let nav = UINavigationController.init(rootViewController: mainVC)
        nav.modalPresentationStyle = .overFullScreen
        nav.modalTransitionStyle = .crossDissolve
        self.present(nav, animated: true, completion: nil)
        
        
        
//        let testVC = TestViewController()
//        self.present(testVC, animated: true, completion: nil)
        
//        self.navigationController!.pushViewController(nav, animated: true)
    }

}
